<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  author: Jsonor
  date: 2018/5/14 13:45
  description: Description
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<html>
<head>
  <script language="javascript">
    function prom() {
      var name=prompt("请输入您的打赏金额")
    }
    if(name)
    {
      alert("欢迎您："+ name)
    }
  </script>
  <style>
    #div1 img {
      cursor: pointer;
      transition: all 0.6s;
    }

    #div1 img:hover {
      transform: scale(1.2);
    }

    body {
      background: url("../img/121.jpg") no-repeat;
      background-size: 1920px;
      margin-left: 90px;
    }

    li {
      list-style-type: none;
    }
  </style>
</head>
<body>
<%@include file="daohanglan.jsp"%>
<div>
  <img src="../img/3.png" style="position: absolute;width: 200px;margin-left: 40%;top:20px;">
</div>
<div id="block" style="overflow-y:scroll;border: 2px solid white;box-sizing: border-box;background:rgba(255,255,255,0.5);width:620px;height:870px;margin-top: 100px;margin-left: 455px;padding:30px;border-radius:30px; ">
  <c:forEach var="p" items="${products}">
    <div style="border: 2px solid GrayText;width: 530px;height: 290px;margin: 10px;overflow-y:scroll;">
      <li> 用户：${user.username}</li>
      <li>名称：${p.name}</li>
      <li id="div1">
        <img width="200px" height="150px" style="margin-left: 150px;"
             src="${pageContext.request.contextPath}/img/${p.image}" alt=""></li>
      <li>描述：${p.describe}</li>
      <hr width="80%">
      <c:choose>
        <c:when test="${p.comment eq null}">
          <li class="li-product">
          <li>XXX：</li>
        </c:when>
        <c:otherwise>
          <c:forEach var="c" items="${p.comment}">
            <li class="li-product">
            <li>${c.user.username}：${c.comment}</li>
          </c:forEach>
        </c:otherwise>
      </c:choose>
      <li>评论：<form action="${pageContext.request.contextPath}/product/comment.do">
        <input  type="hidden" class="com" name="pid" value="${p.pid}" />
        <input  type="text" class="com" name="com" value="" required/>
        <button type="submit" >确认提交</button>
      </form></li>
      <form action="${pageContext.request.contextPath}/product/record.do">
        <input type="text" name="money">
        <input style="display: none;" type="text" name="username" value="${user.username}">
        <input style="display: none;" type="text" name="name" value="${p.name}">
        <input type="submit" value="打赏">
      </form>
    </div>
  </c:forEach>

</div>
</body>
</html>
